package com.ykdl.member.kid.beans;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ykdl.member.kid.models.FileMetas;

import android.text.TextUtils;

import net.wxxr.http.interfaces.IJsonParser;

public class FollowerActor implements IJsonParser, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8722220013805251493L;
	/**
	 * "actor_id": 20934,
        "actor_type": 1,
        "created_time": 1397004903,
        "display_name": "淇宝妈咪",
        "gender": 0,
        "level": 13,
        "total_gold": 0,
        "total_xp": 10152,
        "user_id": 20934
	 */
	
	private int actor_id;
	private int actor_type = 1;
	private String created_time;
	private String display_name;
	private int gender;
	private int level;
	private long total_gold;
	private long total_xp;
	private long user_id;
	private FileMetas avatar_file_meta;
	private ProfileBean profile;
	private BabyProfileBean baby_profile;
	
	public int getActor_id() {
		return actor_id;
	}

	public void setActor_id(int actor_id) {
		this.actor_id = actor_id;
	}

	public int getActor_type() {
		return actor_type;
	}

	public void setActor_type(int actor_type) {
		this.actor_type = actor_type;
	}

	public String getCreated_time() {
		return created_time;
	}

	public void setCreated_time(String created_time) {
		this.created_time = created_time;
	}

	public String getDisplay_name() {
		return display_name;
	}

	public void setDisplay_name(String display_name) {
		this.display_name = display_name;
	}

	public int getGender() {
		return gender;
	}

	public void setGender(int gender) {
		this.gender = gender;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public long getTotal_gold() {
		return total_gold;
	}

	public void setTotal_gold(long total_gold) {
		this.total_gold = total_gold;
	}

	public long getTotal_xp() {
		return total_xp;
	}

	public void setTotal_xp(long total_xp) {
		this.total_xp = total_xp;
	}

	public long getUser_id() {
		return user_id;
	}

	public void setUser_id(long user_id) {
		this.user_id = user_id;
	}
	
	public FileMetas getAvatar_file_meta() {
		return avatar_file_meta;
	}

	public void setAvatar_file_meta(FileMetas avatar_file_meta) {
		this.avatar_file_meta = avatar_file_meta;
	}
	
	public ProfileBean getProfile() {
		return profile;
	}

	public void setProfile(ProfileBean profile) {
		this.profile = profile;
	}

	public BabyProfileBean getBaby_profile() {
		return baby_profile;
	}

	public void setBaby_profile(BabyProfileBean baby_profile) {
		this.baby_profile = baby_profile;
	}

	@Override
	public IJsonParser parse(String json) throws Exception {
		if (!TextUtils.isEmpty(json)) {
			GsonBuilder builder = new GsonBuilder();
			Gson gson = builder.create();
			return gson.fromJson(json, FollowerActor.class);
		}
		return null;
	}

//	public  FollowerActor fromJson(String json) throws JSONException{
//		JSONObject  jo = new JSONObject(json);
//		
//		setActor_id(jo.getInt("actor_id"));
//		setActor_type(jo.getInt("actor_type"));
//		setCreated_time(jo.getString("created_time"));
//		setDisplay_name(jo.getString("display_name"));
//		setGender(jo.getInt("gender"));
//		setLevel(jo.getInt("level"));
//		setTotal_gold(jo.getInt("total_gold"));
//		setTotal_xp(jo.getInt("total_xp"));
//		setUser_id(jo.getInt("user_id"));
//		
//		return this;
//	}
}
